
package com.abcijkxyz.controller.gtvg;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.abcijkxyz.domain.gtvg.Order;
import com.abcijkxyz.service.gtvg.OrderService;

@Controller
@RequestMapping(value = "/order/details")
public class OrderDetailsController implements IGTVGController {

	public String process(final HttpServletRequest request, final HttpServletResponse response, Model model) throws Exception {

		final Integer orderId = Integer.valueOf(request.getParameter("orderId"));

		final OrderService orderService = new OrderService();
		final Order order = orderService.findById(orderId);

		model.addAttribute("order", order);

		return "order/details";
	}

}
